package com.xu.mylol.fragment;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ListView;

import com.xu.mylol.R;
import com.xu.mylol.adapter.MyListViewadapter;
import com.xu.mylol.bean.Video;

import java.util.ArrayList;

/**
 * Created by dllo on 16/1/8.
 */
public class Fragment_Video extends Fragment {
    private ListView listView;
    private WebView webView;
    private MyListViewadapter myListViewadapter;
    private Toolbar toolbar;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_video,null);
        toolbar = (Toolbar) view.findViewById(R.id.video_toolbar);
        toolbar.setTitle("欢迎来到视频联盟");
//        ArrayList<Video> data = new ArrayList<>();
//        for (int i = 0; i < 100; i++) {
//            data.add(new Video("精彩视频",R.mipmap.video_ic));
//        }
//        listView = (ListView) view.findViewById(R.id.video_listview);
//        myListViewadapter = new MyListViewadapter(data,getActivity());
//        listView.setAdapter(myListViewadapter);

//        Intent intent = new Intent(Intent.ACTION_VIEW);
//
//        Uri uri = Uri.parse("http://forum.ea3w.com/coll_ea3w/attach/2008_10/12237832415.3gp");
//        intent.setData (uri);
//        startActivity(intent);
        webView = (WebView) view.findViewById(R.id.video_web_view);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.setWebViewClient(new WebViewClient());

        webView.loadUrl("http://lol.qq.com/m/act/a20150319lolapp/video.htm");
        return  view;
    }


}
